home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 14 / CU Amiga Magazine's Super CD-ROM 14 (1997)(EMAP Images)(GB)(Track 1 of 3)[!][issue 1997-09].iso / CUCD / Programming / Mesa-2.2 / widgets-mesa / src / GLwMakeCurrent.c < prev    next >
Encoding:
C/C++ Source or Header  |  1997-01-31  |  1.3 KB  |  41 lines

  1. /* GLwMakeCurrent.c -- Implementation file for the Mesa widget
  2.    Copyright (C) 1995, 1996 Thorsten.Ohl @ Physik.TH-Darmstadt.de
  3.  
  4.    This library is free software; you can redistribute it and/or
  5.    modify it under the terms of the GNU Library General Public
  6.    License as published by the Free Software Foundation; either
  7.    version 2 of the License, or (at your option) any later version.
  8.  
  9.    This library is distributed in the hope that it will be useful,
  10.    but WITHOUT ANY WARRANTY; without even the implied warranty of
  11.    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  12.    GNU Library General Public License for more details.
  13.  
  14.    You should have received a copy of the GNU Library General Public
  15.    License along with this library; if not, write to the Free Software
  16.    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  17.  
  18.    $Id: GLwMakeCurrent.c,v 1.2 1996/09/30 00:21:06 ohl Exp $
  19.  */
  20.  
  21. #include <X11/IntrinsicP.h>
  22. #include <X11/CoreP.h>
  23. #include <GL/MesaDrawingAreaP.h>
  24.  
  25. void
  26. GLwMakeCurrent (Widget w)
  27. {
  28.   if (XtIsSubclass (w, mesaDrawingAreaWidgetClass))
  29. #ifdef AVOID_MESABUFFER_INTERFACE
  30.     glXMakeCurrent (XtDisplay (w), XtWindow (w), MesaContext (w));
  31. #else
  32.     XMesaMakeCurrent (MesaContext (w), MesaBuffer (w));
  33. #endif
  34.   else
  35.     XtAppError (XtWidgetToApplicationContext (w),
  36.         "Not a MesaDrawingArea widget!");
  37. }
  38.  
  39. /* The End. */
  40.  
  41.